package org.grow.commodity.controller;

import org.grow.commodity.dao.CommodityTypeDao;
import org.grow.commodity.entity.CommodityType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: xwg
 * @CreateDate: 21-8-10
 */

@RestController
@RequestMapping("/commodity/CommodityType")
public class CommodityTypeController {

    @Autowired
    private CommodityTypeDao commodityTypeDao;

    @GetMapping("/all")
    public List<CommodityType> findAllTypes(){
        return commodityTypeDao.findAll();
    }
}
